package ma.co.ba.BusinessApplications.presentation.components;

import java.beans.PropertyEditorSupport;

import ma.co.ba.BusinessApplications.business.tickets.TicketBusiness;
import ma.co.ba.BusinessApplications.model.Etat;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EtatEditor extends PropertyEditorSupport {

	@Autowired
	TicketBusiness ticketBusiness;

	@Override
	public void setAsText(String text) {
		Etat etat = this.ticketBusiness.getEtatById(Integer.valueOf(text));
		this.setValue(etat);
	}
}
